package dissertation.extensions.ejbmodule.view;

import dissertation.services.ejbmodule.EJBModuleService;
import dissertation.services.ejbmodule.IEJBModuleService;

import javax.swing.*;
import java.awt.*;

public class ComponentPanel extends JPanel {

    private final JComboBox jComboBoxVersion;

    public ComponentPanel() {
        setLayout(new FlowLayout(FlowLayout.LEFT));
        add(new JLabel("Version:"));
        jComboBoxVersion = new JComboBox();
        IEJBModuleService ejbModuleService = new EJBModuleService();
        for (String version : ejbModuleService.getSupportedEJBVersions()) {
            jComboBoxVersion.addItem(version);
        }

        add(jComboBoxVersion);
    }

    public String getSelectedVersion() {
        return (String) jComboBoxVersion.getSelectedItem();
    }
}
